"""author:djr
   date:2021/5/20
"""
import json
registry=[]
def a(func):
    def add_name():
        registry.append(func.__name__)
        print(f"{func.__name__}使用了装饰器a")
    return add_name
@a
def b():
    print("this is b")
@a
def c():
    print("this is c")
@a
class f(object):
   def d(self):
     print("this is d")
b()
c()
s=f()
print(f"以下这些函数或者类使用了本装饰器{registry}")
js = json.dumps(registry, ensure_ascii=False)
print(js)